<template>
  <div>
    <!-- near区域 -->
    <div class="nearby">
      <h3 class="nearby__name">附近店铺</h3>
      <router-link  
      :to="{ 
        name: 'Detail' ,
        params:{
          id:item._id

      }}"
      v-for="item in nearbyList" 
      :key="item._id">
      <ShopInfo 
     
      :item="item"
      />
      </router-link>
    </div>
  </div>
</template>

<script>
import { get } from "../../../utils/utils";

import ShopInfo from '../ShopInfo/ShopInfo'
export default {
  name: "NearBy",
  components:{
    ShopInfo
  },
  data() {
    return {
      nearbyList: [],

    };
  },
  mounted() {
    //记得结构数据
    get("/api/shop/hot-list").then(({ data }) => {
      this.nearbyList = data;
    });
  },
 
};
</script>

<style lang="scss" scoped>
//near
.nearby {
  &__name {
    font-size: 0.18rem;
    color: #333333;
    margin: 0.16rem 0 0.02rem 0;
  }
  
}
</style>
